home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group95b.txt
/
000040_icon-group-sender _Thu Jun 8 11:01:25 1995.msg
< prev
next >
Wrap
Internet Message Format
|
1995-09-18
|
1KB
Received: by cheltenham.cs.arizona.edu; Thu, 8 Jun 1995 12:39:58 MST
Date: Thu, 08 Jun 1995 11:01:25 -0500
From: "Mark B. Emmer" <Mark.Emmer@internetmci.com>
Subject: Re: implementation of integers in Icon
To: "icon-group@cs.arizona.edu" <icon-group@cs.arizona.edu>
Message-Id: <01HRGQGSZLIA985KIR@MAILSRV1.PCY.MCI.NET>
X-Mailer: e-mailMCI v2.3
Content-Transfer-Encoding: 7BIT
Errors-To: icon-group-errors@cs.arizona.edu
-- [ From: Mark B. Emmer * EMC.Ver #2.3 ] --
> Is there any information available that explains how in Icon (infinite)
> integers are represented and processed?
Large integers are stored in a b_bignum struct, which has a few header
words, and then an array of ints. In 32-bit implementations, each array
element holds a 16-bit "digit", so the number is stored in base 65536 form.
The b_bignum block will vary in size with the magnitude of the number.
If you have the source, examine b_bignum in rstructs.h, and the code for
manipulating large integers in rlrgint.r or rlrgint.c (depending upon the
age of your source). Although some of the boundary conditions that the
code has to worry about are arcane, overall it's a fairly readable piece of
code.
-- Mark